/***********************************************************************************************************************************
 * Name:	Job_REPL-Snapshot.sql
 * Author:	Frank Figearo (frank.figearo@us.bbaaviation.com|frank@sqlnerd.me)
 * Summary:	Start *all* snapshot jobs.
 */
SET IMPLICIT_TRANSACTIONS OFF; IF 0 < @@TRANCOUNT ROLLBACK;
USE msdb;
GO
DECLARE @tsql_command NVARCHAR(MAX)=N'';
SELECT @tsql_command+= N'EXECUTE sp_start_job @job_id= ''' + CAST(job_id AS NVARCHAR(36)) + '''; '
  FROM sysjobs j
	INNER JOIN syscategories c ON (j.category_id = c.category_id)
  WHERE c.name = N'REPL-Snapshot' AND j.enabled = 1;
PRINT @tsql_command;
EXECUTE (@tsql_command);
GO